from process import db_connect
from process import baseFunction as bf
from process.stockHq import PrealMarketStatic
import json


def getRealMarketStatic(dateStr) -> str:
    # 构造返回结果
    print(dateStr)
    result_data = PrealMarketStatic.result(dateStr)
    result = db_connect.R(code=200, success=True,
                          msg="Data fetched successfully", data=result_data)

    json_result = json.dumps(result, cls=bf.CustomEncoder)
    return json_result
